<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class LoginRequest extends BasicRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'username'		=> 'bail|required|min:2|max:32',
			'password'		=> 'bail|required|min:6|max:32',
        ];
    }
    
    public function messages()
	{
		return [
			'username.required'		=> '请填写用户名',
			'username.min'			=> '用户名最少为2位',
			'username.max'			=> '用户名超出最大字符限制',
			'password.required'		=> '请填写登录密码',
			'password.min'			=> '登录密码最少为6位数',
			'password.max'			=> '登录密码超出最大字符限制',
		];
	}
}
